package list_test;

import java.util.LinkedList;

public class LinkedListDemo {
	public static void main(String[] args) {
		LinkedList<String> linkedList=new LinkedList<String>();
		linkedList.addFirst("a");
		linkedList.addFirst("b");
		linkedList.addFirst("c");
		System.out.println(linkedList);
		System.out.println(linkedList.getFirst());
		System.out.println(linkedList.getLast());
		System.out.println(linkedList.removeFirst());
		System.out.println(linkedList.removeLast());
		while(!linkedList.isEmpty()) {
			System.out.println(linkedList.pop());
		}
		System.out.println(linkedList);
	}
}
